package com.zhongjian.technologycal.mall.activity.personal.activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.widget.TextView;

import com.zhongjian.technologycal.mall.R;
import com.zhongjian.technologycal.mall.activity.personal.fragment.PresenterNoFragment;
import com.zhongjian.technologycal.mall.activity.personal.fragment.PresenterOverFragment;
import com.zhongjian.technologycal.mall.adapter.CommonViewPagerAdapter;
import com.zhongjian.technologycal.mall.base.BaseActivity;
import com.zhongjian.technologycal.mall.utils.AppTools;
import com.zhongjian.technologycal.mall.utils.StatusBarUtil;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by wei on 2017/11/14.
 * 名额赠送
 */

public class MallPresenterActivity extends BaseActivity {
    public static final String CATEGORY_NAME = "com.nanchen.aiyagirl.module.category.CategoryFragment.CATEGORY_NAME";
    @BindView(R.id.tv_main_title)
    TextView tv_main_title;
    @BindView(R.id.mall_order_tab)
    TabLayout mTabLayout;
    @BindView(R.id.mall_order_vp)
    ViewPager mViewPager;
    private static int TAB_MARGIN_DIP = 60;
    private int tabStutus;
    private String[] titles = {"未赠送","已赠送"};

    protected void beforeInit() {
        super.beforeInit();
//        StatusBarUtil.setColorNoTranslucent(this, getResources().getColor(R.color.border_color));
//        StatusBarUtil.setMiuiStatusBarDarkMode(this, true);
    }
    @Override
    public void initPresenter() {

    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        tv_main_title.setText("名额赠送");

        CommonViewPagerAdapter infoPagerAdapter = new CommonViewPagerAdapter(getSupportFragmentManager(),titles);
        PresenterNoFragment fragment0 = PresenterNoFragment.newInstance(titles[0]);
        PresenterOverFragment fragment1 = PresenterOverFragment.newInstance(titles[1]);

        infoPagerAdapter.addFragment(fragment0);
        infoPagerAdapter.addFragment(fragment1);

        mViewPager.setAdapter(infoPagerAdapter);
        mTabLayout.setupWithViewPager(mViewPager);
        mViewPager.setCurrentItem(0);
        mViewPager.setOffscreenPageLimit(2);
        AppTools.setIndicator(this,mTabLayout,TAB_MARGIN_DIP,TAB_MARGIN_DIP);
    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.activity_mall_order_list;
    }
    @OnClick(R.id.iv_back_page)
    public void onClickBack(){
        finish();
    }



}
